export default function (searchInfo, selfInfo) {
    let startTime = '1000-01-01';
    let endTime = this.props.vendorsFmtDate(new Date());
    let billStatus = searchInfo['billStatus'].map((item, index) => {
        return item.key;
    });
    let params = {
        pkProject: searchInfo['pkProject'].length ? searchInfo['pkProject'] : [],
        creators: searchInfo['userId'].length ? searchInfo['userId'] : [],
        startTime: searchInfo['sectionDate'].startTime ? searchInfo['sectionDate'].startTime : startTime,
        endTime: searchInfo['sectionDate'].endTime ? searchInfo['sectionDate'].endTime : endTime,
        billType: 'FGD',
        pageStart: searchInfo['pageStart'] ? searchInfo['pageStart'] : 0,
        pageSize: 10,
        billStatus,
        pkOrg: '',
        extendsParams: {
            pkorgs: searchInfo['pkOrganization'].length ? searchInfo['pkOrganization'].join(',') : ''
        }
    }
    this.props.ajax({
        url: '/billView/queryList',
        data: params,
        success: (res) => {
            let { resultCode, result, exMsg } = res.data;
            let type = selfInfo ? selfInfo.type : '';
            if (resultCode === 'ok') {
                let { objects, count } = result;
                if (objects && !type) {
                    this.props.vendorsSuccess({ 'text': `查询成功,共${count}条` });
                } else if (type === 'refresh') {
                    this.setState({ activePage: 1});
                    this.props.vendorsSuccess({ 'text': '刷新成功' });
                } else if (type === 'pagination') {
                    // this.props.vendorsSuccess({ 'text': '查询成功' })
                } else {
                    this.props.vendorsSuccess({ 'text': '查询成功' });
                }
                this.setState({
                    tableData: objects == null ? [] : objects,
                    paginationItems: Math.ceil(count / 10)
                })
            } else {
                this.props.vendorsDanger({ 'text': exMsg });
            }
        },
        error: () => {

        }
    });
}